import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  const swaggerOptions = new DocumentBuilder()
    .setTitle('client api service')
    .setDescription('前端api接口文档')
    .setVersion('0.0.1')
    .build()
  const document = SwaggerModule.createDocument(app, swaggerOptions)
  SwaggerModule.setup('api-doc', app, document)

  const port = process.env.APP_SERVER_PORT || 3001 
  await app.listen(port);
  console.info('client-api-service run at ' + port)
}
bootstrap();
